package com.szgr.baoyin.utils;

import android.widget.Toast;

import com.szgr.baoyin.MyApplication;
import com.szgr.baoyin.R;

/**
 * Created by Jimbo on 2015/10/10.
 */
public class ToastUtils {
    private static Toast toast = null;
    private ToastUtils(){}

    public static void showToast(String text){
        showToast(text,Toast.LENGTH_SHORT);
    }

    public static void showToast(String text,int duration){
        if(toast == null){
            toast = toast.makeText(MyApplication.getmInstance(), text ,duration);
        }
        toast.setText(text);
        toast.setDuration(duration);
        toast.show();
    }
}
